package com.example.xrecyclerview;

import android.content.Context;
import android.widget.TextView;

/**
 * Created by jianghejie on 15/11/26.
 */
public class BaseTestAdapter extends BaseAdapter<String> {


    public BaseTestAdapter(Context context) {
        super(context);
    }

    @Override
    public BaseViewHolder bindViewHolder(ViewUtils viewUtils) {
        return new ViewHolder(viewUtils);
    }


    @Override
    public int bindLayoutId() {
        return R.layout.item;
    }

    @Override
    public  void initViewsAndValues(BaseViewHolder viewHolder, int position) {

        ViewHolder viewHolderTmp= (ViewHolder) viewHolder;


        viewHolderTmp.mTextView.setText(datas.get(position)+"哈哈哈");
    }



    //自定义的ViewHolder，持有每个Item的的所有界面元素
    public static class ViewHolder extends BaseAdapter.BaseViewHolder {
        public TextView mTextView;
        public ViewHolder(ViewUtils viewUtils){
            super(viewUtils.getRootView());
            mTextView = viewUtils.view(R.id.text,TextView.class);
        }
    }



}
